home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / mac / tclMac.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-15  |  3.1 KB  |  102 lines  |  [TEXT/CWIE]

  1. /*
  2.  * tclMac.h --
  3.  *
  4.  *    Declarations of Macintosh specific public variables and procedures.
  5.  *
  6.  * Copyright (c) 1997 Sun Microsystems, Inc.
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  * SCCS: @(#) tclMac.h 1.8 97/06/24 18:59:08
  12.  */
  13.  
  14. #ifndef _TCLMAC
  15. #define _TCLMAC
  16.  
  17. #ifndef _TCL
  18. #   include "tcl.h"
  19. #endif
  20. #include <Types.h>
  21. #include <Files.h>
  22. #include <Events.h>
  23.  
  24. /*
  25.  * "export" is a MetroWerks specific pragma.  It flags the linker that  
  26.  * any symbols that are defined when this pragma is on will be exported 
  27.  * to shared libraries that link with this library.
  28.  */
  29.  
  30. #pragma export on
  31.  
  32. typedef int (*Tcl_MacConvertEventPtr) _ANSI_ARGS_((EventRecord *eventPtr));
  33.  
  34. /*
  35.  * This is needed by the shells to handle Macintosh events.
  36.  */
  37.  
  38. EXTERN void  Tcl_MacSetEventProc _ANSI_ARGS_((Tcl_MacConvertEventPtr procPtr));
  39.  
  40. /*
  41.  * These routines are useful for handling using scripts from resources 
  42.  * in the application shell
  43.  */
  44.  
  45. EXTERN char *    Tcl_MacConvertTextResource _ANSI_ARGS_((Handle resource));
  46. EXTERN int     Tcl_MacEvalResource _ANSI_ARGS_((Tcl_Interp *interp,
  47.             char *resourceName, int resourceNumber, char *fileName));
  48. EXTERN Handle    Tcl_MacFindResource _ANSI_ARGS_((Tcl_Interp *interp,
  49.             long resourceType, char *resourceName,
  50.             int resourceNumber, char *resFileRef, int * releaseIt));
  51.  
  52. /* These routines support the new OSType object type (i.e. the packed 4
  53.  * character type and creator codes).
  54.  */
  55.                                    
  56. EXTERN int        Tcl_GetOSTypeFromObj _ANSI_ARGS_((Tcl_Interp *interp,
  57.                 Tcl_Obj *objPtr, OSType *osTypePtr));
  58. EXTERN void        Tcl_SetOSTypeObj _ANSI_ARGS_((Tcl_Obj *objPtr, 
  59.                 OSType osType));
  60. EXTERN Tcl_Obj *    Tcl_NewOSTypeObj _ANSI_ARGS_((OSType osType));
  61.  
  62.  
  63.  
  64. /*
  65.  * The following routines are utility functions in Tcl.  They are exported
  66.  * here because they are needed in Tk.  They are not officially supported,
  67.  * however.  The first set are from the MoreFiles package.
  68.  */
  69.  
  70. EXTERN pascal    OSErr    FSpGetDirectoryID(const FSSpec *spec,
  71.                 long *theDirID, Boolean *isDirectory);
  72. EXTERN pascal    short    FSpOpenResFileCompat(const FSSpec *spec,
  73.                 SignedByte permission);
  74. EXTERN pascal    void    FSpCreateResFileCompat(const FSSpec *spec,
  75.                 OSType creator, OSType fileType,
  76.                 ScriptCode scriptTag);
  77. /* 
  78.  * Like the MoreFiles routines these fix problems in the standard
  79.  * Mac calls.  These routines is from tclMacUtils.h.
  80.  */
  81.  
  82. EXTERN int     FSpLocationFromPath _ANSI_ARGS_((int length, char *path,
  83.             FSSpecPtr theSpec));
  84. EXTERN OSErr     FSpPathFromLocation _ANSI_ARGS_((FSSpecPtr theSpec,
  85.             int *length, Handle *fullPath));
  86.  
  87. /*
  88.  * These are not in MSL 2.1.2, so we need to export them from the
  89.  * Tcl shared library.  They are found in the compat directory
  90.  * except the panic routine which is found in tclMacPanic.h.
  91.  */
  92.  
  93. EXTERN int    strncasecmp _ANSI_ARGS_((CONST char *s1,
  94.                 CONST char *s2, size_t n));
  95. EXTERN int    strcasecmp _ANSI_ARGS_((CONST char *s1,
  96.                 CONST char *s2));
  97. EXTERN void    panic _ANSI_ARGS_(TCL_VARARGS(char *,format));
  98.  
  99. #pragma export reset
  100.  
  101. #endif /* _TCLMAC */
  102.